package com.Maykk.charStream;

import java.io.*;

/**
 * @ClassName: Demo08
 * @Description: TODO
 * @Author: MaykkStar@163.com
 */
public class Demo08 {
    public static void main(String[] args) throws IOException {
        final String SRC = "./Maykk.txt";
        final String TO = "./MaykkNew.txt";
        BufferedReader br = new BufferedReader(new FileReader(SRC));
        BufferedWriter bw = new BufferedWriter(new FileWriter(TO));

        String line;
        while ((line = br.readLine()) != null) { // readLine 读完返回的是 null
            bw.write(line); // 一次写一行
            bw.newLine();   // 根据当前系统环境自动添加换行符
            bw.flush();     // 刷新流
        }

        bw.close();
        br.close();
    }
}
